package com.nondo.dean.order.mapper;

import com.nondo.dean.order.domain.TransferDetail;
import com.nondo.dean.order.model.param.TransferDetailParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author xiaofan
 * @Description:
 * @throws
 * @date 2018-06-1914:34
 * @Version
 */
@Component
public interface TransferDetailExtendsMapper {

    /**
     * 查询经销商打款记录表生成凭证
     * @param transferDetailParam
     * @return
     */
    @Select("select * from transfer_detail where bank_id=#{bankId,jdbcType=INTEGER} AND DATE_FORMAT(remittance_time,'%Y-%m-%d')=#{remitTanceTime,jdbcType=VARCHAR} and del_flag=0 and status !=4")
    List<TransferDetail> selectByExample(TransferDetailParam transferDetailParam);

    /**
     * 打印凭证
     * @param transferDetailParam
     * @return
     */
    @Select("select * from transfer_detail where sap_no=#{sapNo,jdbcType=VARCHAR} AND remittance_time like '%${remitTanceTime}%' and del_flag=0")
    List<TransferDetail> selectProof(TransferDetailParam transferDetailParam);

}
